#include "CFGCodeManager.h"
using namespace xml_api;

CCFGCodeManager::CCFGCodeManager(void)
{
  m_filter = false;
}

CCFGCodeManager::~CCFGCodeManager(void)
{
}

bool CCFGCodeManager::SaveState(xml_api::Memento* m)
{
  return true;
}

bool CCFGCodeManager::LoadState(xml_api::Memento* m)
{
  m_filter = m->GetInteger("filter") == 0 ? false : true;

  int child_num=m->GetChildCount();
  for(int i=0; i<child_num; ++i)
  {
    Memento* child_m=m->GetChild(i);
    std::string child_name = child_m->GetName();
    if("Code" == child_name)
    {
      CCFGCode code;
      code.LoadState(child_m);
      m_arr_code.push_back(code);
    }
  }

  return true;
}
